package FileClass;

import java.io.File;

public class dirTree {

	public static void dirTree(int n, String path) {
		File f = new File(path);
		if (f.exists()) {
			for (int i = 0; i < n; i++) {
				System.out.print("   ");
			}
			if (n > 0)
				System.out.print("|____");
			System.out.println(f.getName());
			// In cac tap tin hoac thu muc con
			if (f.isDirectory()) {
				File[] files = f.listFiles();
				if (files.length > 0) {
					for (int i = 0; i < files.length; i++) {
						dirTree(n + 1, files[i].getAbsolutePath());
					}
				}
			}
		}
	}

	public static void dirTree(String path) {
		dirTree(0, path);
	}

	public static void main(String[] args) {
		dirTree("E:\\Inpaint");
	}
}
